import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/com_title06_entity.dart';

ComTitle06Entity $ComTitle06EntityFromJson(Map<String, dynamic> json) {
  final ComTitle06Entity comTitle06Entity = ComTitle06Entity();
  final String? subText = jsonConvert.convert<String>(json['sub_text']);
  if (subText != null) {
    comTitle06Entity.subText = subText;
  }
  final String? moreText = jsonConvert.convert<String>(json['more_text']);
  if (moreText != null) {
    comTitle06Entity.moreText = moreText;
  }
  final int? pageMarginTop = jsonConvert.convert<int>(json['page_margin_top']);
  if (pageMarginTop != null) {
    comTitle06Entity.pageMarginTop = pageMarginTop;
  }
  final String? titleSize = jsonConvert.convert<String>(json['title_size']);
  if (titleSize != null) {
    comTitle06Entity.titleSize = titleSize;
  }
  final String? descWeight = jsonConvert.convert<String>(json['desc_weight']);
  if (descWeight != null) {
    comTitle06Entity.descWeight = descWeight;
  }
  final ComTitle06Link? link = jsonConvert.convert<ComTitle06Link>(json['link']);
  if (link != null) {
    comTitle06Entity.link = link;
  }
  final String? textAlignType = jsonConvert.convert<String>(json['text_align_type']);
  if (textAlignType != null) {
    comTitle06Entity.textAlignType = textAlignType;
  }
  final ComTitle06BgImage? bgImage = jsonConvert.convert<ComTitle06BgImage>(json['bg_image']);
  if (bgImage != null) {
    comTitle06Entity.bgImage = bgImage;
  }
  final String? uuid = jsonConvert.convert<String>(json['uuid']);
  if (uuid != null) {
    comTitle06Entity.uuid = uuid;
  }
  final String? modBgcolor = jsonConvert.convert<String>(json['mod_bgcolor']);
  if (modBgcolor != null) {
    comTitle06Entity.modBgcolor = modBgcolor;
  }
  final ComTitle06MoreImage? moreImage = jsonConvert.convert<ComTitle06MoreImage>(json['more_image']);
  if (moreImage != null) {
    comTitle06Entity.moreImage = moreImage;
  }
  final String? descColor = jsonConvert.convert<String>(json['desc_color']);
  if (descColor != null) {
    comTitle06Entity.descColor = descColor;
  }
  final bool? showTopRadius = jsonConvert.convert<bool>(json['show_top_radius']);
  if (showTopRadius != null) {
    comTitle06Entity.showTopRadius = showTopRadius;
  }
  final bool? showBottomRadius = jsonConvert.convert<bool>(json['show_bottom_radius']);
  if (showBottomRadius != null) {
    comTitle06Entity.showBottomRadius = showBottomRadius;
  }
  final bool? showMore = jsonConvert.convert<bool>(json['show_more']);
  if (showMore != null) {
    comTitle06Entity.showMore = showMore;
  }
  final int? pageMarginBottom = jsonConvert.convert<int>(json['page_margin_bottom']);
  if (pageMarginBottom != null) {
    comTitle06Entity.pageMarginBottom = pageMarginBottom;
  }
  final int? pageMargin = jsonConvert.convert<int>(json['page_margin']);
  if (pageMargin != null) {
    comTitle06Entity.pageMargin = pageMargin;
  }
  final String? titleColor = jsonConvert.convert<String>(json['title_color']);
  if (titleColor != null) {
    comTitle06Entity.titleColor = titleColor;
  }
  final String? borderRadiusType = jsonConvert.convert<String>(json['border_radius_type']);
  if (borderRadiusType != null) {
    comTitle06Entity.borderRadiusType = borderRadiusType;
  }
  final String? descSize = jsonConvert.convert<String>(json['desc_size']);
  if (descSize != null) {
    comTitle06Entity.descSize = descSize;
  }
  final String? bgColor = jsonConvert.convert<String>(json['bg_color']);
  if (bgColor != null) {
    comTitle06Entity.bgColor = bgColor;
  }
  final String? moreType = jsonConvert.convert<String>(json['more_type']);
  if (moreType != null) {
    comTitle06Entity.moreType = moreType;
  }
  final String? titleWeight = jsonConvert.convert<String>(json['title_weight']);
  if (titleWeight != null) {
    comTitle06Entity.titleWeight = titleWeight;
  }
  final int? radiusNum = jsonConvert.convert<int>(json['radius_num']);
  if (radiusNum != null) {
    comTitle06Entity.radiusNum = radiusNum;
  }
  final int? pageMarginIner = jsonConvert.convert<int>(json['page_margin_iner']);
  if (pageMarginIner != null) {
    comTitle06Entity.pageMarginIner = pageMarginIner;
  }
  final String? mainText = jsonConvert.convert<String>(json['main_text']);
  if (mainText != null) {
    comTitle06Entity.mainText = mainText;
  }
  return comTitle06Entity;
}

Map<String, dynamic> $ComTitle06EntityToJson(ComTitle06Entity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['sub_text'] = entity.subText;
  data['more_text'] = entity.moreText;
  data['page_margin_top'] = entity.pageMarginTop;
  data['title_size'] = entity.titleSize;
  data['desc_weight'] = entity.descWeight;
  data['link'] = entity.link?.toJson();
  data['text_align_type'] = entity.textAlignType;
  data['bg_image'] = entity.bgImage?.toJson();
  data['uuid'] = entity.uuid;
  data['mod_bgcolor'] = entity.modBgcolor;
  data['more_image'] = entity.moreImage?.toJson();
  data['desc_color'] = entity.descColor;
  data['show_top_radius'] = entity.showTopRadius;
  data['show_bottom_radius'] = entity.showBottomRadius;
  data['show_more'] = entity.showMore;
  data['page_margin_bottom'] = entity.pageMarginBottom;
  data['page_margin'] = entity.pageMargin;
  data['title_color'] = entity.titleColor;
  data['border_radius_type'] = entity.borderRadiusType;
  data['desc_size'] = entity.descSize;
  data['bg_color'] = entity.bgColor;
  data['more_type'] = entity.moreType;
  data['title_weight'] = entity.titleWeight;
  data['radius_num'] = entity.radiusNum;
  data['page_margin_iner'] = entity.pageMarginIner;
  data['main_text'] = entity.mainText;
  return data;
}

extension ComTitle06EntityExtension on ComTitle06Entity {
  ComTitle06Entity copyWith({
    String? subText,
    String? moreText,
    int? pageMarginTop,
    String? titleSize,
    String? descWeight,
    ComTitle06Link? link,
    String? textAlignType,
    ComTitle06BgImage? bgImage,
    String? uuid,
    String? modBgcolor,
    ComTitle06MoreImage? moreImage,
    String? descColor,
    bool? showTopRadius,
    bool? showBottomRadius,
    bool? showMore,
    int? pageMarginBottom,
    int? pageMargin,
    String? titleColor,
    String? borderRadiusType,
    String? descSize,
    String? bgColor,
    String? moreType,
    String? titleWeight,
    int? radiusNum,
    int? pageMarginIner,
    String? mainText,
  }) {
    return ComTitle06Entity()
      ..subText = subText ?? this.subText
      ..moreText = moreText ?? this.moreText
      ..pageMarginTop = pageMarginTop ?? this.pageMarginTop
      ..titleSize = titleSize ?? this.titleSize
      ..descWeight = descWeight ?? this.descWeight
      ..link = link ?? this.link
      ..textAlignType = textAlignType ?? this.textAlignType
      ..bgImage = bgImage ?? this.bgImage
      ..uuid = uuid ?? this.uuid
      ..modBgcolor = modBgcolor ?? this.modBgcolor
      ..moreImage = moreImage ?? this.moreImage
      ..descColor = descColor ?? this.descColor
      ..showTopRadius = showTopRadius ?? this.showTopRadius
      ..showBottomRadius = showBottomRadius ?? this.showBottomRadius
      ..showMore = showMore ?? this.showMore
      ..pageMarginBottom = pageMarginBottom ?? this.pageMarginBottom
      ..pageMargin = pageMargin ?? this.pageMargin
      ..titleColor = titleColor ?? this.titleColor
      ..borderRadiusType = borderRadiusType ?? this.borderRadiusType
      ..descSize = descSize ?? this.descSize
      ..bgColor = bgColor ?? this.bgColor
      ..moreType = moreType ?? this.moreType
      ..titleWeight = titleWeight ?? this.titleWeight
      ..radiusNum = radiusNum ?? this.radiusNum
      ..pageMarginIner = pageMarginIner ?? this.pageMarginIner
      ..mainText = mainText ?? this.mainText;
  }
}

ComTitle06Link $ComTitle06LinkFromJson(Map<String, dynamic> json) {
  final ComTitle06Link comTitle06Link = ComTitle06Link();
  final String? linkType = jsonConvert.convert<String>(json['link_type']);
  if (linkType != null) {
    comTitle06Link.linkType = linkType;
  }
  final String? linkTitle = jsonConvert.convert<String>(json['link_title']);
  if (linkTitle != null) {
    comTitle06Link.linkTitle = linkTitle;
  }
  final int? linkId = jsonConvert.convert<int>(json['link_id']);
  if (linkId != null) {
    comTitle06Link.linkId = linkId;
  }
  return comTitle06Link;
}

Map<String, dynamic> $ComTitle06LinkToJson(ComTitle06Link entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['link_type'] = entity.linkType;
  data['link_title'] = entity.linkTitle;
  data['link_id'] = entity.linkId;
  return data;
}

extension ComTitle06LinkExtension on ComTitle06Link {
  ComTitle06Link copyWith({
    String? linkType,
    String? linkTitle,
    int? linkId,
  }) {
    return ComTitle06Link()
      ..linkType = linkType ?? this.linkType
      ..linkTitle = linkTitle ?? this.linkTitle
      ..linkId = linkId ?? this.linkId;
  }
}

ComTitle06BgImage $ComTitle06BgImageFromJson(Map<String, dynamic> json) {
  final ComTitle06BgImage comTitle06BgImage = ComTitle06BgImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    comTitle06BgImage.attachmentUrl = attachmentUrl;
  }
  return comTitle06BgImage;
}

Map<String, dynamic> $ComTitle06BgImageToJson(ComTitle06BgImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension ComTitle06BgImageExtension on ComTitle06BgImage {
  ComTitle06BgImage copyWith({
    String? attachmentUrl,
  }) {
    return ComTitle06BgImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}

ComTitle06MoreImage $ComTitle06MoreImageFromJson(Map<String, dynamic> json) {
  final ComTitle06MoreImage comTitle06MoreImage = ComTitle06MoreImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    comTitle06MoreImage.attachmentUrl = attachmentUrl;
  }
  return comTitle06MoreImage;
}

Map<String, dynamic> $ComTitle06MoreImageToJson(ComTitle06MoreImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension ComTitle06MoreImageExtension on ComTitle06MoreImage {
  ComTitle06MoreImage copyWith({
    String? attachmentUrl,
  }) {
    return ComTitle06MoreImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}
